<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Returns the comment of an entry using the entry index</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="ziparchive.getarchivecomment.html">« ZipArchive::getArchiveComment</a></li>
      <li style="float: right;"><a href="ziparchive.getcommentname.html">ZipArchive::getCommentName »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="class.ziparchive.html">ZipArchive</a></li>
    <li>Returns the comment of an entry using the entry index</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="ziparchive.getcommentindex" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">ZipArchive::getCommentIndex</h1>
  <p class="verinfo">(PHP 5 &gt;= 5.2.0, PHP 7, PHP 8, PECL zip &gt;= 1.4.0)</p><p class="refpurpose"><span class="refname">ZipArchive::getCommentIndex</span> &mdash; <span class="dc-title">Returns the comment of an entry using the entry index</span></p>

 </div>
 <div class="refsect1 description" id="refsect1-ziparchive.getcommentindex-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="modifier">public</span> <span class="methodname"><strong>ZipArchive::getCommentIndex</strong></span>(<span class="methodparam"><span class="type">int</span> <code class="parameter">$index</code></span>, <span class="methodparam"><span class="type">int</span> <code class="parameter">$flags</code><span class="initializer"> = 0</span></span>): <span class="type"><span class="type">string</span>|<span class="type"><span class="type false">false</span></span></span></div>

  <p class="para rdfs-comment">
   Returns the comment of an entry using the entry index.
  </p>
 </div>

 <div class="refsect1 parameters" id="refsect1-ziparchive.getcommentindex-parameters">
  <h3 class="title">参数</h3>
  <p class="para">
   <dl>
    
     <dt>
<code class="parameter">index</code></dt>

     <dd>

      <p class="para">
       Index of the entry
      </p>
     </dd>

    
    
     <dt>
<code class="parameter">flags</code></dt>

     <dd>

      <p class="para">
       If flags is set to <strong><code>ZipArchive::FL_UNCHANGED</code></strong>, the original unchanged
       comment is returned.
      </p>
     </dd>

    
   </dl>

  </p>
 </div>

 <div class="refsect1 returnvalues" id="refsect1-ziparchive.getcommentindex-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   Returns the comment on success 或者在失败时返回 <strong><code>false</code></strong>.
  </p>
 </div>

 <div class="refsect1 examples" id="refsect1-ziparchive.getcommentindex-examples">
  <h3 class="title">范例</h3>
    <div class="example" id="example-841">
     <p><strong>示例 #1 Dump an entry comment</strong></p>
     <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br />$zip&nbsp;</span><span style="color: #007700">=&nbsp;new&nbsp;</span><span style="color: #0000BB">ZipArchive</span><span style="color: #007700">;<br /></span><span style="color: #0000BB">$res&nbsp;</span><span style="color: #007700">=&nbsp;</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">open</span><span style="color: #007700">(</span><span style="color: #DD0000">'test1.zip'</span><span style="color: #007700">);<br />if&nbsp;(</span><span style="color: #0000BB">$res&nbsp;</span><span style="color: #007700">===&nbsp;</span><span style="color: #0000BB">TRUE</span><span style="color: #007700">)&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;</span><span style="color: #0000BB">var_dump</span><span style="color: #007700">(</span><span style="color: #0000BB">$zip</span><span style="color: #007700">-&gt;</span><span style="color: #0000BB">getCommentIndex</span><span style="color: #007700">(</span><span style="color: #0000BB">1</span><span style="color: #007700">));<br />}&nbsp;else&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'failed,&nbsp;code:'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">$res</span><span style="color: #007700">;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
     </div>

    </div>
   </div>

</div></div></div></body></html>